<template>
  <el-icon class="align-middle" style="vertical-align: -0.2em">
    <component :is="getIcon(name)" />
  </el-icon>
</template>
<script setup lang="ts">
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

defineProps<{
  name: string;
}>();

function getIcon(name: string) {
  // @ts-expect-error
  return ElementPlusIconsVue[name];
}
</script>
